package cn.edu.scau.cmi.wujiaxian.exercise10;

import java.io.IOException;
import java.io.RandomAccessFile;

public class Example10_9 {
	
	public static void main(String[] args) {
		RandomAccessFile io = null;
		try {
			io = new RandomAccessFile("C:\\Users\\lenovo\\git\\201734020124_wu_jiaxian\\201734020124吴嘉贤\\src\\cn\\edu\\scau\\cmi\\wujiaxian\\exercise10\\Example10_9.java", "rw");
			long length = io.length();
			long position = 0;
			io.seek(position);
			while (position < length) {
				String line = io.readLine();
				byte[] bytes = line.getBytes("iso-8859-1");
				line = new String(bytes);
				position = io.getFilePointer();
				System.out.println(line);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		
	}
	
}
